﻿using System.Reflection;

#nullable disable
namespace BeetleX.XRPC
{
    internal class FieldHandler
    {
        private FieldInfo mField;
        private GetValueHandler mGetValue;
        private SetValueHandler mSetValue;

        public FieldHandler(FieldInfo field)
        {
            this.mGetValue = ReflectionHandlerFactory.FieldGetHandler(field);
            this.mSetValue = ReflectionHandlerFactory.FieldSetHandler(field);
            this.Field = field;
        }

        public FieldInfo Field
        {
            get => this.mField;
            private set => this.mField = value;
        }

        public GetValueHandler GetValue => this.mGetValue;

        public SetValueHandler SetValue => this.mSetValue;
    }
}
